package 剑指offer;

/**
 * @author zhangjunfei
 * @date 2023/8/7 11:11
 */
public class O_53_02 {

    public int missingNumber(int[] nums) {
        int left = 0, right = nums.length;
        //区间为：左闭右开

        while(left < right) {
            int m = left + (right - left) / 2;

            if(nums[m] == m)
                left = m + 1;
            else
                right = m;
        }
        return left;
    }
}
